﻿using HiTeachers.Data.Manager;
using HiTeachers.Entities;
using HiTeachers.Interfaces;

namespace HiTeachers.Services
{
    public class SiteConfigServices
    {
        private static readonly ISiteConfigDao SiteConfigDao = NHibernateDaoFactory.Instance.GetSiteConfigDao();

        public static SiteConfig SaveOrUpdate(SiteConfig siteConfig)
        {
            return siteConfig.ID == 0 ? SiteConfigDao.Save(siteConfig) : SiteConfigDao.SaveOrUpdate(siteConfig);
        }

        public static SiteConfig GetByTextKey(string textKey)
        {
            return SiteConfigDao.GetByTextKey(textKey);
        }
    }
}
